<template>
  <div class="control-items">
    <el-button @click="joinGroup" class="control-item">加入群组</el-button>
  </div>
</template>

<script>
export default {
  name: 'groups-list-controls', // 群组列表上的快捷操作
  methods: {
    joinGroup() {
      this.$prompt('请输入邀请码', '加入群组', {
        customClass: 'confirm-left',
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(({ value }) => {
        this.$router.push(`/groups/join/${value}`);
      }).catch(() => {});
    },
  },
};
</script>

<style></style>
